home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / swingall.jar / javax / swing / event / TreeModelEvent.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-07-15  |  2.3 KB  |  92 lines

  1. package javax.swing.event;
  2.  
  3. import java.util.EventObject;
  4. import javax.swing.tree.TreePath;
  5.  
  6. public class TreeModelEvent extends EventObject {
  7.    protected TreePath path;
  8.    protected int[] childIndices;
  9.    protected Object[] children;
  10.  
  11.    public TreeModelEvent(Object var1, TreePath var2) {
  12.       super(var1);
  13.       this.path = var2;
  14.       this.childIndices = new int[0];
  15.    }
  16.  
  17.    public TreeModelEvent(Object var1, TreePath var2, int[] var3, Object[] var4) {
  18.       super(var1);
  19.       this.path = var2;
  20.       this.childIndices = var3;
  21.       this.children = var4;
  22.    }
  23.  
  24.    public TreeModelEvent(Object var1, Object[] var2) {
  25.       this(var1, new TreePath(var2));
  26.    }
  27.  
  28.    public TreeModelEvent(Object var1, Object[] var2, int[] var3, Object[] var4) {
  29.       this(var1, new TreePath(var2), var3, var4);
  30.    }
  31.  
  32.    public int[] getChildIndices() {
  33.       if (this.childIndices != null) {
  34.          int var1 = this.childIndices.length;
  35.          int[] var2 = new int[var1];
  36.          System.arraycopy(this.childIndices, 0, var2, 0, var1);
  37.          return var2;
  38.       } else {
  39.          return null;
  40.       }
  41.    }
  42.  
  43.    public Object[] getChildren() {
  44.       if (this.children != null) {
  45.          int var1 = this.children.length;
  46.          Object[] var2 = new Object[var1];
  47.          System.arraycopy(this.children, 0, var2, 0, var1);
  48.          return var2;
  49.       } else {
  50.          return null;
  51.       }
  52.    }
  53.  
  54.    public Object[] getPath() {
  55.       return this.path != null ? this.path.getPath() : null;
  56.    }
  57.  
  58.    public TreePath getTreePath() {
  59.       return this.path;
  60.    }
  61.  
  62.    public String toString() {
  63.       StringBuffer var1 = new StringBuffer();
  64.       var1.append(this.getClass().getName() + " " + Integer.toString(this.hashCode()));
  65.       if (this.path != null) {
  66.          var1.append(" path " + this.path);
  67.       }
  68.  
  69.       if (this.childIndices != null) {
  70.          var1.append(" indicices [ ");
  71.  
  72.          for(int var2 = 0; var2 < this.childIndices.length; ++var2) {
  73.             var1.append(Integer.toString(this.childIndices[var2]) + " ");
  74.          }
  75.  
  76.          var1.append("]");
  77.       }
  78.  
  79.       if (this.children != null) {
  80.          var1.append(" children [ ");
  81.  
  82.          for(int var3 = 0; var3 < this.children.length; ++var3) {
  83.             var1.append(String.valueOf(this.children[var3]) + " ");
  84.          }
  85.  
  86.          var1.append("]");
  87.       }
  88.  
  89.       return var1.toString();
  90.    }
  91. }
  92.